home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / pyshared / Onboard / Pane.py < prev    next >
Encoding:
Python Source  |  2008-03-03  |  802 b   |  31 lines

  1. class Pane:
  2.     "The pane holds the keys and is drawn by the keyboard widget."
  3.     def __init__(self,keyboard,ident,keys,columns,viewPortSizeX,viewPortSizeY,rgba,fontSize):
  4.         self.ident = ident
  5.         self.keys = keys
  6.         self.viewPortSizeX = viewPortSizeX
  7.         self.viewPortSizeY = viewPortSizeY
  8.         self.fontSize = fontSize
  9.         self.xScale = 1
  10.         self.xScale = 1
  11.         self.rgba = rgba
  12.         self.keyboard = keyboard
  13.         self.columns = columns
  14.         return
  15.  
  16.  
  17.     def paint(self,context,width,height):
  18.         
  19.         self.xScale = width/self.viewPortSizeX
  20.                 self.yScale = height/self.viewPortSizeY
  21.         
  22.         for key in self.keys.values():
  23.                     key.paint(self.xScale, self.yScale, context)
  24.  
  25.                 
  26.                 for key in self.keys.values():
  27.                     key.paintFont(self.xScale, self.yScale, context)
  28.  
  29.         return
  30.  
  31.